
/*

Design Pattern Automation Toolkit.
Application to create applications with emphasis on Design patterns.
And support for round trip engineering.
Copyright (C) 2004 Vineeth Neelakant. nvineeth@gmail.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/
using System;using BusinessLayer;using InfoClasses;using dpatoolkit.UILayer;
using System.Collections;
using System.Data;
using DesignPatternDefinitions;

namespace BusinessLayer
{
	/// <summary>
	/// concrete class for parameter
	/// </summary>
	public class DPParameter: IParameter
	{
		private DataRow paramRow;
		MetaInfoEditor mie ;
		public DPParameter(DataRow prow)
		{
			this.paramRow=prow;
			mie = new MetaInfoEditor((string)this.paramRow[SchemaNames.MetaInfo]);
		}

		#region IParameter Members
		public string GetMetaInfo(string language)
		{
			
			return mie.GetMetaInfo(language);
		}
		public void SetMetaInfo(string meta)
		{
			//not required, protection against malicious plugins.
		}
		public Hashtable GetAllMetaInfo()
		{
			return mie.GetAllMetaInfo();
		}

		public string Summary
		{
			get
			{
				return (string) this.paramRow[SchemaNames.Summary];
			}
			set
			{
				// TODO:  Add DPParameter.Summary setter implementation
			}
		}

		public string ParameterType
		{
			get
			{
				return (string) this.paramRow[SchemaNames.ParameterType];
			}
			set
			{
				// TODO:  Add DPParameter.ParameterType setter implementation
			}
		}

		public string ParameterName
		{
			get
			{
				return (string) this.paramRow[SchemaNames.ParameterName];
			}
			set
			{
				// TODO:  Add DPParameter.ParameterName setter implementation
			}
		}

		public string GetUMLRepresentation()
		{
			 return (string) this.paramRow[SchemaNames.ParameterName]+":"+ (string) this.paramRow[SchemaNames.ParameterType];
		}

		#endregion
	}
}
